package com.kc.sjwh.entity.vo.table;
import java.io.Serializable;

/**
 * 表格cell(td或th)
 * ClassName: Cell
 * date: 2017年5月3日 下午4:39:16
 * @author zhangGuihua(hua7381@163.com)
 */
public class Cell implements Serializable {
	private String html;
	private Integer rowSpan = 1;
	private Integer colSpan = 1;
	private String color;
	private String align;
	private boolean show = true;
	
	protected String getStyles() {
		String style = "";
		if(color != null) {
			style += " color:"+color;
		}
		if(align!=null) {
			style += " text-align:"+align;
		}
		if(style.length()>0) {
			style = " style='"+style+"'";
		}
		String rowspan = (getRowSpan() == null || getRowSpan() ==1) ? "" : " rowspan='"+getRowSpan()+"'";
		String colspan = (getColSpan() == null || getColSpan() ==1) ? "" : " colspan='"+getColSpan()+"'";
		return style + rowspan + colspan;
	}
	
	public String getAlign() {
		return align;
	}
	public void setAlign(String align) {
		this.align = align;
	}
	public boolean getShow() {
		return show;
	}
	public Integer getColSpan() {
		return colSpan;
	}
	public void setColSpan(Integer colSpan) {
		this.colSpan = colSpan;
	}
	public void setShow(boolean show) {
		this.show = show;
	}
	public String getHtml() {
		if(html == null) html = "";
		return html;
	}
	public void setHtml(String html) {
		this.html = html;
	}
	public Integer getRowSpan() {
		return rowSpan;
	}
	public void setRowSpan(Integer rowSpan) {
		this.rowSpan = rowSpan;
	}
	public String getColor() {
		return color;
	}
	public void setColor(String color) {
		this.color = color;
	}
}